package yinghan;
import java.util.Scanner;
public class Operation {
    public void addMoney(Account account,Scanner sc){
        System.out.println("请输入存款数额：");
        int money=sc.nextInt();
        if(money>0){
            account.setMoney(money+account.getMoney());
            System.out.println("存款成功！");
        }else{
            System.out.println("存款数额不能为零或负！");
        }
    }

    public void findMoney(Account account,Scanner sc){
        System.out.println("您的余额为："+account.getMoney());
    }

    public void putMoney(Account account,Scanner sc){
        System.out.println("请输入你的取款额：");
        int money=sc.nextInt();
        if(0<money&&money<account.getMoney()){
            System.out.println("取款成功！");
            System.out.println("根据国家诈骗法，现在取款需要打印小票，并且免费");
            account.setMoney(account.getMoney()-money);
        }else{
            System.out.println("余额不足！");
        }
    }

}

